package com.wzt.estest.doc;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author Zenith
 */
@Document(indexName = "test",type = "emp")
public class EmpDoc {
    @Id //文档id字段
    private Long id;

    @Field(type = FieldType.Keyword) //不分词
    private String name;

    @Field(type = FieldType.Integer)
    private Integer age;

    @Field(type = FieldType.Text,analyzer = "ik_smart"
            ,searchAnalyzer = "ik_smart")
    private String intro;

    public EmpDoc(Long id, String name, Integer age, String intro) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.intro = intro;
    }

    public EmpDoc() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }
}
